package com.atfusu.base;

import com.github.pagehelper.PageInfo;


import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * Title:
 * Author: fusu
 * DateTime:  2022/11/25
 * Description:
 **/
public interface BaseService<T> {
    /**
    *@Author: fusu
    *@Description: 查询所有数据
    *@DateTime:21:05 2022/11/25
    *@params: []
    *@return java.util.List<T>
    */
    List<T> findAll();

    /**
    *@Author: fusu
    *@Description: 新增记录
    *@DateTime:21:06 2022/11/25
    *@params: [role]
    *@return void
    */
    void insert(T t);

    /**
    *@Author: fusu
    *@Description: 查找一条记录
    *@DateTime:21:06 2022/11/25
    *@params: [id]
    *@return T
    */
    T getById(Serializable id);

    /**
    *@Author: fusu
    *@Description: 修改记录
    *@DateTime:21:07 2022/11/25
    *@params: [role]
    *@return void
    */
    void update(T t);

    /**
    *@Author: fusu
    *@Description: 删除数据
    *@DateTime:21:07 2022/11/25
    *@params: [id]
    *@return void
    */
    void delete(Serializable id);


    /**
    *@Author: fusu
    *@Description: 条件查询及分页功能
    *@DateTime:21:07 2022/11/25
    *@params: [filters]
    *@return com.github.pagehelper.PageInfo<T>
    */
    PageInfo<T> findPage(Map<String, Object> filters);
}
